from flask import Blueprint
from flask_restful import Resource, fields, marshal_with

def create_HOME_blueprint(app,blueprint_url_prefix):
    home_web = Blueprint('HOME_web',
                             __name__,
                             template_folder='../../templates/Home/',
                             static_folder="../../static/Home/",
                             static_url_path="/static"
                             )
    from .Default import Default_redprint
    Default_redprint.register(home_web,url_prefix=None)


    from .MusicRoutes import music_redprint
    music_redprint.register(home_web,url_prefix=None)

    app.register_blueprint(home_web, url_prefix=blueprint_url_prefix)






''':cvar
admin_bp=Blueprint('admin',__name__,
                      template_folder='../../templates/Admin/'
                      ,static_folder="../../static/Admin/"
                      ,static_url_path="/statics"
                      )

from Applications.routes.admin.Default import *



from flask import Blueprint
from .Admins import admins_redprint
from .Default import login_redprint
from .menusRoutes import menu_redprint
from .ArticlesRoutes import article_redprint


# 封装函数配置蓝本
def create_adminweb_blueprint(app,blueprint_url_prefix):
    admin_web = Blueprint('admin_web',__name__)
    admins_redprint.register(admin_web,url_prefix=None)
    login_redprint.register(admin_web,url_prefix=None)
    menu_redprint.register(admin_web,url_prefix=None)
    article_redprint.register(admin_web,url_prefix=None)

    app.register_blueprint(admin_web, url_prefix=blueprint_url_prefix)



DEFAULT_BLUEPRINT = (
    # (蓝本，前缀)
    (admin_blueprint, '/admin'),
)

def create_adminweb_blueprint(app):
    for blueprint, url_prefix in DEFAULT_BLUEPRINT:
        app.register_blueprint(blueprint, url_prefix=url_prefix)

'''



'''
def create_adminweb():
    admin_web = Blueprint('admin_web',__name__)
    Admins.admins_routes.register(admin_web,url_prefix=None)
    Admins.admins_API.register(admin_web, url_prefix=None)


    return admin_web
'''
